<%#encoding: UTF-8 %>
wymeditor_boot_options.toolsItems.push({'name': 'AddVideo', 'title': 'Add_Video', 'css': 'wym_tools_add_video'});

<% locales = %w(en es sk pt-BR zh-CN)%>
<% locales.each do |locale| %>
  if (WYMeditor.STRINGS['<%=locale%>']) WYMeditor.STRINGS['<%=locale%>']['Video'] = WYMeditor.STRINGS['<%=locale%>']['Add_Video'] = '<%= I18n.t(:add_video, :scope => :wym_tools, :locale => locale) %>';
<% end %>

onCloseDialog = function(){
   $('iframe#dialog_iframe').attr('src', '');
};

WYMeditor.editor.prototype.exec_without_video = WYMeditor.editor.prototype.exec;
WYMeditor.editor.prototype.exec = function(cmd) {
	if (cmd == 'AddVideo') {
		this.dialog('Video');
	} else this.exec_without_video(cmd);
}
